class ModifyController < ApplicationController
  def modify_book_info
    @book_info = TbBookinfo.find(params[:id])
  end
  def updatebook
    @book_info = TbBookinfo.find(params[:id])
    @book_info.update({barcode: params[:barcode],bookname: params[:bookname],typeid: params[:typeid],author: params[:author],authorcomtroy: params[:authorcomtroy],translator: params[:translator],ISBN: params[:ISBN],price: params[:price],bookcase: params[:bookcase],bookcotent: params[:bookcotent]})
     render :json =>{}
  end
  def destroy_book_info
    @book_info = TbBookinfo.find(params[:id])
    @book_info.destroy
    redirect_to '/gallery_books_page/gallery_books_page'
  end
  def modify_pblish
    @pblish_info = TbPublish.find(params[:id])
  end
  def updatepblish
    @pblish_info = TbPublish.find(params[:id])
    @pblish_info.update({ISBN: params[:ISBN],pubname: params[:pubname],pubaddr: params[:pubaddr],Zip_code: params[:Zip_code],first_pubtel: params[:first_pubtel],second_pubtel: params[:second_pubtel],pubperson: params[:pubperson]})
    render :json =>{}
  end
  def destroy_pblish_info
    @publish_info = TbPublish.find(params[:id])
    @publish_info.destroy
    redirect_to '/gallery_books_page/gallery_pblish'
  end
  def modify_book_type
    @book_type = TbBooktype.find(params[:id])
  end
  def updatetype
    @book_type = TbBooktype.find(params[:id])
    @book_type.update({booktypeid: params[:booktypeid],Typename: params[:Typename],Type_outline: params[:Type_outline]})
    render :json =>{}
  end
  def destroy_book_type
    @book_type = TbBooktype.find(params[:id])
    @book_type.destroy
    redirect_to '/gallery_books_page/gallery_book_type'
  end
end
